//
//  SDImageCache.h
//  SKinDiary
//
//  Created by pcyang on 16/6/26.
//  Copyright © 2016年 tencent. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "SDHttpRequestManagement.h"

@interface SDImageCacheEx : NSObject //Not Thread Safe
DEF_SINGLETON;

//- (UIImage*)getMemoryImageWithNameInMainBundle:(NSString*)name;
//- (UIImage*)getMemoryImageWithNameInMainBundle:(NSString*)name modifyIdentifier:(NSString*)modifyIdentifier;
- (UIImage*)getMemoryImageWithURL:(NSString*)url;

- (UIImage*)getLocalImageWithURL:(NSString*)url;
//- (UIImage*)getMemoryImageWithIdentifier:(NSString*)identifier;

- (void)getImageWithIdentifier:(NSString*)identifier
                 creationBlock:(UIImage* (^)(void))block
                    completion:(void (^)(UIImage *image))completion;

- (UIImage*)getImageWithNameInMainBundle:(NSString*)name;
- (UIImage*)getImageWithPath:(NSString*)path;


- (void)getImageWithNameInMainBundle:(NSString*)name
                          completion:(void (^)(UIImage *image))completion;

- (void)getImageWithURL:(NSString*)url
             identifier:(NSString*)identifier
             completion:(void (^)(UIImage *image))completion;

- (void)getImageWithURL:(NSString*)url
             identifier:(NSString*)identifier
            modifyBlock:(UIImage* (^)(UIImage* image))block
       modifyIdentifier:(NSString*)modifyIdentifier
             completion:(void (^)(UIImage *image))completion;

- (void)getImageWithURL:(NSString*)url
             identifier:(NSString*)identifier
               priority:(SDHttpRequestPriority)priority
            modifyBlock:(UIImage* (^)(UIImage* image))block
       modifyIdentifier:(NSString*)modifyIdentifier
             completion:(void (^)(UIImage *image))completion;

- (void)stopGettingImage:(NSString*)url identifier:(NSString*)identifier;

- (void)deleteCatchImageWithURL:(NSString*)url;
//- (void)clearMemoryImageWithNameInMainBundle:(NSString*)name;
//- (void)clearMemoryImageWithNameInMainBundle:(NSString*)name modifyIdentifier:(NSString*)modifyIdentifier;
//- (void)clearMemoryImageWithURL:(NSString*)url modifyIdentifier:(NSString*)modifyIdentifier;
//- (void)clearMemoryImageWithIdentifier:(NSString*)identifier;

- (void)getLocalImageWithURL:(NSString*)url
                  identifier:(NSString*)identifier
                  completion:(void (^)(UIImage *image))completion;
- (void)cleanImageCatch;
@end

